package com.example.coursehub.repository;

import com.example.coursehub.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;
import java.util.Optional;


public interface UserRepository extends JpaRepository<User, String> , JpaSpecificationExecutor<User>{

    // Spring Data JPA 会根据方法名自动提供这些方法的实现
    Optional<User> findByUserAccount(String userAccount);

    Optional<User> findByUserIdAndUserPassword(String userId, String userPassword);

    User findUsersByUserId(String userId);
}